"""
======================
Author: 柠檬班-小简
Time: 2022/11/4 21:25
Project: day10_framwork_V7
Company: 湖南零檬信息技术有限公司
======================
"""
from setttings import shop_mysql
from tools.handle_replace import replace_mark_by_data
from tools.my_mysql import HandleMySql
from tools.global_data import Data

# sql_str = 'SELECT mobile_code FROM tz_sms_log WHERE user_phone="#new_phone#"'
#
# # 1、先做替换 -- 如果有##
# sql_pha = replace_mark_by_data(sql_str)
# print(sql_pha)
# # 2、再去执行sql语句
# hmysql = HandleMySql(**shop_mysql)
# result = hmysql.select_and_get_result(sql_pha)
# print(result)
# hmysql.close_db()
# # 3、将执行的结果，设置为全局变量。
# for key,value in result.items():
#     setattr(Data, key, str(value))
#
# print(Data.__dict__)


sql_str = '[SELECT mobile_code FROM tz_sms_log WHERE user_phone="#new_phone#",SELECT user_name FROM tz_sms_log WHERE user_phone="#new_phone#"]'